export const FormRules = {
  requiredFields: [
    {
      required: true,
      message: '必填项不能为空'
    }
  ],
  mobile: [
    {
      pattern:
        /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/,
      message: '请输入正确手机号'
    },
    {
      required: true,
      message: '手机号不能为空'
    }
  ],
  username: [
    {
      required: true,
      message: '账号不能为空'
    },
    {
      pattern: /^[a-z0-9]{3,16}$/,
      message: '用户名必须是3~16个字符的数字或字母'
    }
  ],
  password: [
    {
      required: true,
      message: '密码不能为空'
    },
    {
      pattern: /^[a-z0-9]{6,}$/,
      message: '最少六位的数字或字母'
    }
  ],
  code: [
    {
      required: true,
      message: '验证码不能为空'
    },
    {
      pattern: /^\d{6}$/,
      message: '最少六位的字符'
    }
  ],
  identity: [
    {
      required: true,
      message: '身份证不能为空'
    },
    {
      pattern:
        /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/,
      message: '请输入正确身份证号'
    }
  ]
}
